﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace MS
{
    public class UploadResultLogManager
    {
        public int WriteLog(UploadResultLog log)
        {
            string sql = "insert into UploadResultLog  values(@LogType,@LogSchoolCode,@LogSchoolName,@LogTime,@LogResult,@LogError,@LogFileUpLoadTime)";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter("@LogType",log.LogType),
                new SqlParameter("@LogSchoolCode",log.LogSchoolCode),
                new SqlParameter("@LogSchoolName",log.LogSchoolName),
                new SqlParameter("@LogTime",log.LogTime),
                new SqlParameter("@LogError",log.LogError),
                new SqlParameter("@LogFileUpLoadTime",log.LogFileUpLoadTime),
            };
            SqlConnection conn = new SqlConnection();
            SqlCommand comm = new SqlCommand(sql, conn);
            int n= comm.ExecuteNonQuery();
            return n;

        }
    }
    public class UploadResultLog
    {
        public string LogType { get; set; }
        public string LogSchoolCode{get;set;}
        public string LogSchoolName{get;set;}
        public DateTime LogTime{get;set;}
        public bool LogResult{get;set;}
        public string LogError { get; set; }
        public DateTime LogFileUpLoadTime { get; set; }
    }
}
